package com.sc.nft.service;

import com.alibaba.fastjson.JSONObject;
import com.sc.nft.config.fulu.model.dto.FuLuOrderDirectDTO;
import com.sc.nft.entity.ApiOrderDirect;
import com.sc.nft.enums.ApiOrderStateEnum;

import java.util.List;

/**
 * 福禄订单
 *
 * @author liGen
 * @version 1.0
 * @date 2023/11/15 1:53 下午
 */
public interface ApiOrderDirectService {


    /**
     * 创建福禄订单
     *
     * @param orderId          订单ID
     * @param orderNo          订单编号
     * @param apiProductId     福禄商品ID
     * @param apiChargeAccount 充值账号
     * @param apiBuyNum        购买数量
     * @return
     */
    ApiOrderDirect create(Long orderId, String orderNo, Integer apiProductId, String apiChargeAccount, Integer apiBuyNum);

    /**
     * 获取订单下福禄直充订单
     *
     * @param orderId 订单ID
     * @return
     */
    ApiOrderDirect getByOrderId(Long orderId);

    /**
     * 获取订单下福禄直充订单
     *
     * @param orderNo 订单编号
     * @return
     */
    ApiOrderDirect getByOrderNo(String orderNo);

    /**
     * 获取未处理的直充订单
     *
     * @param apiOrderStateEnum 订单状态
     * @return
     */
    List<ApiOrderDirect> getByApiOrderState(ApiOrderStateEnum apiOrderStateEnum);

    /**
     * 同步直充订单
     *
     * @param resultJson
     * @return
     */
    String synchronizationOrderDirect(JSONObject resultJson);

    /**
     * 直充订单自动失败
     *
     * @param day
     */
    void automaticFailure(Integer day);
}
